$(document).ready(function() {
	var xhr = function(page, variable) {
		var xhr_object = null; 
		
		if(window.XMLHttpRequest) 
			xhr_object = new XMLHttpRequest(); 
		else if(window.ActiveXObject)
			 xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
		else { 
			alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
			return; 
		} 
		 
		xhr_object.open("GET", page+"?"+variable, true);
		xhr_object.send(null);

		xhr_object.onreadystatechange = function() { 
			if(xhr_object.readyState == 4) {
				return xhr_object.responseText;
			 }
		}
	}

	$("#pays").change(function() {
		var code = $(this).val();
		
		$.ajax({
			type: "GET",
			url: "ajax/select_ville.php",
			dataType: "html",
			data: "pays="+code,
			success: function(msg){
				$("#divVille").html(msg);
			}
		});
	});
});